package com.dark.trident;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import storm.trident.spout.ITridentSpout;

import java.io.Serializable;

/**
 * Created by tengxue on 16-6-30.
 */
public class DefaultCoordinator implements ITridentSpout.BatchCoordinator<Long>,Serializable {

    private static final long serialVersionUID=1L;

    private static final Logger LOG= LoggerFactory.getLogger(DefaultCoordinator.class);
    @Override
    public Long initializeTransaction(long txid, Long prevMetadata, Long currMetadata) {
        LOG.info("Initializing Transaction [" + txid+" ]");
        return null;
    }

    @Override
    public void success(long txid) {
        LOG.info("Successful Transaction [" + txid+" ]");
    }

    @Override
    public boolean isReady(long txid) {
        return true;
    }

    @Override
    public void close() {

    }
}
